package syntelos.sx;

import syntelos.sys.FileCacheLimit;

/**
 * Statistical collection including blacklisting. 
 */
public final class Accounting {

    public final static void Validate(Request request){
        if (FileCacheLimit.IsValid(request))
            return;
        else
            throw new alto.sys.RequestEntityTooLargeException();
    }
    public final static void Complete(Server server, Request request, Response response){

        server.logWrite(request,response);
    }
    public final static void Complete(Server server, Request request, Response response, java.lang.Throwable error){
        if (null != request)
            server.logWrite(request,response,error);
        else {
            synchronized(System.err){
                System.err.print(java.lang.Thread.currentThread().getName()+' ');
                error.printStackTrace(System.err);
            }
        }
    }
}
